/*
 * @Description: 
 * @version: 
 * @Author: wyx
 * @Date: 2020-10-06 12:30:32
 * @LastEditDate: Do not exit
 */
import request from '@/utils/request'

/**
 *添加购物车
 * @param {type} 
 */
export function insert(car){
    return request({url:"/order-service/cart",method:"post",data:car});
}

/**
 *分页查询购物车
 * @param {type} 
 */
export function getByMemberId(keyword){
    return request({url:"/order-service/cart/list",method:"post",data:keyword});
}

/**
 *修改购物车
 * @param {type} 
 */
export function updateCar(car){
    return request({url:"/order-service/cart",method:"put",data:car});
}

/**
 *根据id删除购物车商品
 * @param {type} 
 */
export function removeById(id){
    return request({url:"/order-service/cart/"+id,method:"delete"});
}

/**
 *根据会员id删除购物车选中商品
 * @param {type} 
 */
export function removeByMeId(mId){
    return request({url:"/order-service/cart/deleteByChecked",method:"delete",params:{memberId:mId}});
}

/**
 *根据会员id查询购物车选中商品
 * @param {type} 
 */
export function selectByMeId(mId){
    return request({url:"/order-service/cart/getChecked",method:"post",params:{memberId:mId}});
}
